package string;

import java.util.Scanner;

public class SubstringDemo {
    public static void main(String[] args) {
        /*
        Scanner scan=new Scanner(System.in);
        String str = "www.tedu.cn";
        System.out.println("请输入截取下标的开头");
        int start= scan.nextInt();
        System.out.println("请输入截取下标的结尾");
        int end= scan.nextInt();
        String name = str.substring(start, end);//截取下标4到7的字符串
        System.out.println(name);


         */
        String str = "www.tedu.cn";
        int starts=str.indexOf(".")+1;
        int end = str.indexOf(".",starts);
        String name = str.substring(starts, end);
        System.out.println(name);



    }
}
